var SolrNode = require('solr-node');

// // Create client
// var client = new SolrNode({
//     host: '127.0.0.1',
//     port: '8983',
//     core: 'test',
//     protocol: 'http'
// });

// Set Debug Level
var client = new SolrNode({
  host: '127.0.0.1',
  port: '8983',
  core: 't_course',
  protocol: 'http',
  debugLevel: 'ERROR' // log4js debug level paramter
});

var data = {
  end_date: '2017-10-10T00:00:00Z',
  modifier_name: 'AAA1',
  city: 140100,
  scheduling_state: 0,
  night_end_time: '1970-01-01T20:00:00Z',
  business_Unit_Id: 1,
  am_end_time: '1970-01-01T12:00:00Z',
  modified_time: '2017-10-30T09:27:12Z',
  is_deleted: '0',
  province: 140000,
  project_id: 2773101295444224,
  product_id: 1111111111,
  pm_start_time: '1970-01-01T13:30:00Z',
  start_date: '2017-10-07T00:00:00Z',
  am_start_time: '1970-01-01T09:00:00Z',
  phase: '红领培优A',
  course_id: '2869390340563200',
  pm_end_time: '1970-01-01T17:30:00Z',
  created_time: '2017-10-10T12:07:24Z',
  course_state: 0,
  night_start_time: '1970-01-01T19:00:00Z',
  product_name: 'HTYGJB201800012',
  creater_id: 12576,
  creater_name: '隋海岩',
  branch_department_id: 62,
  course_model: 0,
  district: 140105000000,
  min_openclass_num: 0,
  special_openclass: 1,
  branch_school_id: 19,
  modifier_id: 12576,
  scheduling_confirm_state: 0,
  course_standard: 0,
  approval_state: 2
};

client.update(data, function(err, result) {
  if (err) {
    console.log(err);
    return;
  }
  console.log('Response:', result.responseHeader);
});
